using UnityEngine;

public class Tnt : MonoBehaviour
{
	private Progress _progress;

	private void Start()
	{
		_progress = Object.FindObjectOfType<Progress>();
		Object.Destroy(base.gameObject, 2f);
	}

	private void OnTriggerStay(Collider other)
	{
		if (other.tag == "Finish")
		{
			if (!other.gameObject.TryGetComponent<Rigidbody>(out var component))
			{
				component = other.gameObject.AddComponent<Rigidbody>();
			}
			component.constraints = (RigidbodyConstraints)56;
			component.mass = 0.1f;
			component.isKinematic = false;
			other.tag = "Player";
			_progress.KillBlock();
		}
	}
}
